package de.se.ludoapp.response;

/**
 * General Response Class with error-code and message
 * 
 * @author Marlen Rotert
 * 
 */
public class ReturncodeResponse {

	private final int OK_CODE = 0;

	private int returnCode;
	private String msg;

	public ReturncodeResponse(int returnCode, String msg) {
		this.returnCode = returnCode;
		this.msg = msg;
	}

	public int getReturnCode() {
		return returnCode;
	}

	public void setReturnCode(int returnCode) {
		this.returnCode = returnCode;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	/**
	 * If the response is with error messages, the return value is true. Else
	 * the return value is false.
	 * 
	 * @param response
	 * @return boolean
	 */
	public boolean hasResponseErrors() {
		if (returnCode != this.OK_CODE) {
			return true;
		}
		return false;
	}

}
